Skip to content

Instantly share code, notes, and snippets.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 10, 2024 05:42
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory

MySQL

expandArgs

expandArgs expands any named args that are slices into multiple named args, one for each element in the slice. This is useful for queries that use the IN operator, e.g. SELECT * FROM table WHERE id IN (:id)

  • If there are no args, the original stmt and args are returned.
  • If there are no slices to expand, the original stmt and args are returned.
  • If the args are positional, the original stmt and args are returned, as we can't expand positional args.
  • Only slices of primitives are supported. Slices of structs or other types are not supported.
@pooladkhay
pooladkhay / wayland-blurry-fix.md
Last active May 10, 2024 05:34
VSCode blurry text under Wayland

Source: https://wiki.archlinux.org/title/Visual_Studio_Code#Blurry_text_under_Wayland

Due to Electron issues Visual Studio Code defaults to run under XWayland which may cause blurry text if you're using HiDPI screens.

In order to fix this issue you need to force Electron to run under Wayland by adding --enable-features=UseOzonePlatform --ozone-platform=wayland, for example you'll be launching VSCode like

$ code --enable-features=UseOzonePlatform --ozone-platform=wayland

This fix can be made permanent by creating a .desktop file or by directly editing /usr/share/applications/visual-studio-code.desktop

@wojteklu
wojteklu / clean_code.md
Last active May 10, 2024 05:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@lovasoa
lovasoa / node-walk.es6
Last active May 10, 2024 05:30
Walk through a directory recursively in node.js.
// ES6 version using asynchronous iterators, compatible with node v10.0+
const fs = require("fs");
const path = require("path");
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) yield* walk(entry);
else if (d.isFile()) yield entry;
@hankei6km
hankei6km / git-rebase--onto-tldr.md
Last active May 10, 2024 05:29
git のブランチを別のブランチへ付け替える (git rebase --onto)

git のブランチを別のブランチへ付け替える (git rebase --onto)

たまに --onto を使おうと思うと忘れているのでメモ.

基本(普通に rebase)

これを

%%{init: { 
@robbibt
robbibt / dea_in_r.R
Last active May 10, 2024 05:29
Loading and analysing Digital Earth Australia Sentinel-2 data in R with `rstac` and `gdalcubes`
"""
This code demonstrates how to load Digital Earth Australia Sentinel-2 Analysis Ready Data into R.
It uses `rstac` to search for available data for a time and location using DEA's STAC endpoint,
and `gdalcubes` to load and analyse the data.
Functionality includes:
* Creating a custom pixel grid to reproject data into
* Apply a cloud mask using the "s2cloudless" cloud mask
* Combine data into seasonal composites
* Create an RGB animation
@aaronpolhamus
aaronpolhamus / map_clsloc.txt
Created May 12, 2016 01:21
Image net classes + labels
n02119789 1 kit_fox
n02100735 2 English_setter
n02110185 3 Siberian_husky
n02096294 4 Australian_terrier
n02102040 5 English_springer
n02066245 6 grey_whale
n02509815 7 lesser_panda
n02124075 8 Egyptian_cat
n02417914 9 ibex
n02123394 10 Persian_cat
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active May 10, 2024 05:27
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 10, 2024 05:26
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus